package about_attributes.demo1;

/**
 * @author yuisama
 * @date 2022/09/28 21:06
 **/
public class Main1 {
    //使用内部类
    static class MyThread extends Thread{
        @Override
        public void run() {
            System.out.println(this.getId());
        }
    }

    public static void main(String[] args) {
        Thread thread = Thread.currentThread();
        //当前线程
       // System.out.println(thread.getId());


        MyThread t1 = new MyThread();
        t1.start();

        //线程的ID是不会重复的
        //如果某个线程结束了，它还会统一分配
        MyThread t2 = new MyThread();
        t2.start();
    }
}

